package bdcin.servlet.actions.area;

import java.io.IOException;
import java.util.List;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import bdcin.classesbasicas.Area;
import bdcin.fachada.BDCInFactory;
import bdcin.fachada.IBDCIn;
import bdcin.servlet.actions.Action;

public class ListarAreasAction extends Action {

	@Override
	public void executar(HttpServletRequest request,
			HttpServletResponse response) throws ServletException, IOException {

		IBDCIn facade = BDCInFactory.getFacade();
		
		
		List<Area> resultado = facade.listarAreas();
		request.setAttribute("areas", resultado);
		request.getRequestDispatcher("/area/listarAreas.jsp").forward(request, response);

	}

}
